package org.javaboy.commons.inter;

import org.javaboy.commons.model.User;
import org.springframework.web.bind.annotation.*;

public interface IUserService {
    @GetMapping("/user")
    User getUserById(@RequestParam("id") Integer id, @RequestHeader("token") String token);

    /**
     * 添加用户，key-value 格式的参数
     *
     * @return
     */
    @PostMapping("/user")
    User addUser(@RequestParam("username") String username, @RequestParam("id") Integer id);

    /**
     * JSON 参数
     *
     * @param user
     * @return
     */
    @PutMapping("/user")
    User updateUser(@RequestBody User user);

    @DeleteMapping("/user/{id}")
    void deleteUser(@PathVariable("id") Integer id);
}